extends CanvasLayer
@onready var button: Button = $MarginContainer/Panel/VBoxContainer/Button
@onready var margin_container: MarginContainer = $MarginContainer
@onready var animation_player: AnimationPlayer = $AnimationPlayer

func _ready() -> void:
	button.pressed.connect(on_next_pressed)
	animation_player.play("create")

func on_next_pressed():
	await get_tree().create_timer(.2).timeout
	animation_player.play("close")
	$"/root/LevelManager".to_next_level()

func _process(delta: float) -> void:
	margin_container.pivot_offset = Vector2(margin_container.size.x / 2, margin_container.size.y / 2)
